package com.emellend.api.progressbar;

import com.emellend.api.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
/**
 * 为activity设置不确定需要多久时间的进度条。
 * @author tiangh
 *
 */
public class ProgressBar4 extends Activity {
	
	private boolean mToggleIndeterminate=false;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
		setContentView(R.layout.progressbar_4);
		setProgressBarIndeterminateVisibility(mToggleIndeterminate);
		this.findViewById(R.id.toggle).setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				mToggleIndeterminate=!mToggleIndeterminate;
				setProgressBarIndeterminateVisibility(mToggleIndeterminate);
			}
		});
		
	}
}
